package cn.hd01.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.hd01.repository.entity.TimingSms;

@Repository
public interface TimingSmsRepository extends JpaRepository<TimingSms, Integer> {

	List<TimingSms> findByStatus(String status);
	
	@Transactional
	@Modifying
	@Query("update TimingSms set status = ?1 where id = ?2")
	int updateStatus(String status, Integer id);
	
}
